package com.corecloud.mapper.mysql;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.corecloud.entity.SysRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 *
 *
 * @author CCW
 * @email 452050507@qq.com
 * @date 2020-08-25 11:14:24
 */
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRoleEntity> {

	/**
	 * 根据条件查询SysRoleEntity信息
	 *
	 * @param map
	 * @return SysRoleEntity信息集合
	 */
	@Select({"<script>select * from sys_role ",
			"where 1=1 ",
			"<if test='id !=null'> and id = #{id} </if>",
			"<if test='code != null and code != \"\" '> and code like CONCAT('%',#{code},'%') </if>",
			"<if test='name != null and name != \"\" '> and name like CONCAT('%',#{name},'%') </if>",
			"<if test='isValid !=null'> and is_valid = #{isValid} </if>",
			"</script>"})
	List<SysRoleEntity> getListByParas(Map<String, Object> map);

}
